class @ListingView extends CustomView
    initialize: ->
        super

    pagination: (event) ->
        event.preventDefault()
        Loading.Start()
        @model.set("Page", $(event.currentTarget).data("href"), { silent: true })
        @model.fetch()

    sort: (event) ->
        event.preventDefault()
        Loading.Start()
        @model.set("Column", $(event.currentTarget).attr("column"), { silent: true })
        @model.set("Direction", $(event.currentTarget).attr("direction"), { silent: true })
        @model.fetch()

    edit: (event) ->
        event.preventDefault()
        url = $(event.currentTarget).closest("tr").attr("href")
        if url?
            Loading.Start()
            @Navigate(url, true)
    
    changeSize: (event) ->
        event.preventDefault()
        Loading.Start()
        @model.changeSize($(event.currentTarget).val())
        @model.fetch() 